home *** CD-ROM | disk | FTP | other *** search
Wrap
# # bundle.make # # Inputs from Makefile.preamble (no defaults): # BUNDLELDFLAGS - Additional flags passed to ld when linking bundles # OTHER_CFLAGS - Flags passed to compiler (in addition to -g, -O, etc.) # OTHER_OFILES - Additional relocatables that may be linked in # OTHER_PRODUCT_DEPENDS - Other dependencies of this project # OTHER_SOURCEFILES - Other source files maintained by .pre/postamble # OTHER_GARBAGE - Additional files to be removed by make 'clean' # # MSGFILES - .msg files that should have msgwrap run on them # DEFSFILES - .defs files that should have mig run on them # MIGFILES - .mig files (no .defs files) that should have mig run on them # # PRECOMPS - Precompiled headers that should be built before compilation # OTHER_INITIAL_TARGETS - Targets to be built before subprojects, etc. # # DSTROOT - Virtual root directory prepended to $(INSTALLDIR) # # Inputs from Makefile.postamble (with defaults set by this file): # MAKEFILES - Makefiles this project depends on (default = Makefile) # DEFAULT_CFLAGS - All compiler flags for this level (default set below) # # Inputs from Makefile (avoid setting these, ProjectBuilder controls them): # NAME - name of application # LANGUAGE - langage in which the project is written (default "English") # LOCAL_RESOURCES - localized resources (e.g. nib's, images) of project # GLOBAL_RESOURCES - non-localized resources of project # # CLASSES - Class implementation files in project. # HFILES - Header files in project. # MFILES - Other Objective-C source files in project. # CFILES - Other C source files in project. # PSWFILES - .psw files in the project # PSWMFILES - .pswm files in the project # SUBPROJECTS - Subprojects of this project # BUNDLES - Bundle subprojects of this project # OTHERSRCS - Other miscellaneous sources of this project # OTHERLINKED - Source files not matching a standard source extention # OTHERLINKEDOFILES - Other relocatable files to (always) link in. # # APP_MAKEFILE_DIR - Directory in which to find generic set of Makefiles # MAKEFILEDIR - Directory in which to find $(MAKEFILE) # MAKEFILE - Top level mechanism Makefile (e.g., app.make, bundle.make) # INSTALLDIR - Directory app will be installed into by 'install' target # # Defaults for NeXT-specific Release Control options SRCROOT = . SYMROOT = . OBJROOT = . # Set these in case this is a standalone case (much of this cruftiness has to do with sh's inability to operate on $$bun in the common.make subcomponents rule) DOT = . BUNDLE_DIR = $(SYMROOT)/$(NAME).bproj PRODUCT_ROOT_WITHOUT_EXT = $(BUNDLE_DIR:.bproj=) PRODUCT_ROOT = $(PRODUCT_ROOT_WITHOUT_EXT).$(BUNDLE_EXTENSION) BUNDLE = $(PRODUCT_ROOT)/$(NAME) # ...and relative versions for installing the bundle. REL_BUNDLE_DIR = $(NAME).bproj REL_PRODUCT_ROOT = $(REL_BUNDLE_DIR:.bproj=).$(BUNDLE_EXTENSION) REL_BUNDLE = $(REL_PRODUCT_ROOT)/$(NAME) APP_MAKEFILE_DIR = /NextDeveloper/Makefiles/app include $(APP_MAKEFILE_DIR)/common.make include $(APP_MAKEFILE_DIR)/specialrules.make all bundle:: @($(MKDIRS) $(PRODUCT_ROOT) ; \ $(process_target_archs)_obj ; \ $(set_bundle_ext) ; \ if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \ language_cflags='' ; \ else \ language_cflags='-DKANJI' ; \ fi ; \ $(MAKE) actual_project \ "OFILE_DIR = $(OBJROOT)/$$obj_dir" \ "PROJ_CFLAGS = $(NORMAL_CFLAGS) $$language_cflags" \ "MAKEFILEDIR = $(MAKEFILEDIR)" \ "BUNDLE_EXTENSION = $$bundle_ext" \ "DEVROOT = $(DEVROOT)" \ "RC_CFLAGS = $$arch_cflags" \ "RC_ARCHS = $$archs" \ "SRCROOT = $(SRCROOT)" \ "OBJROOT = $(OBJROOT)" \ "PRODUCT_ROOT = $(PRODUCT_ROOT_WITHOUT_EXT).$$bundle_ext" \ "SYMROOT = $(SYMROOT)/sym" \ "SYM_DIR = $(SYMROOT)/sym" ) debug:: @($(MKDIRS) $(PRODUCT_ROOT) ; \ $(process_target_archs)_debug_obj ; \ $(set_bundle_ext) ; \ if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \ language_cflags='' ; \ else \ language_cflags='-DKANJI' ; \ fi ; \ $(MAKE) actual_project \ "OFILE_DIR = $(OBJROOT)/$$obj_dir" \ "PROJ_CFLAGS = $(DEBUG_CFLAGS) $$language_cflags" \ "MAKEFILEDIR = $(MAKEFILEDIR)" \ "BUNDLE_EXTENSION = $$bundle_ext" \ "DEVROOT = $(DEVROOT)" \ "RC_CFLAGS = $$arch_cflags" \ "RC_ARCHS = $$archs" \ "SRCROOT = $(SRCROOT)" \ "OBJROOT = $(OBJROOT)" \ "PRODUCT_ROOT = $(PRODUCT_ROOT_WITHOUT_EXT).$$bundle_ext" \ "SYMROOT = $(SYMROOT)/sym" \ "SYM_DIR = $(SYMROOT)/sym" ) profile:: @($(MKDIRS) $(PRODUCT_ROOT) ; \ $(process_target_archs)_profile_obj ; \ $(set_bundle_ext) ; \ if [ "$(ENGLISH)" = "YES" -o "$(JAPANESE)" != "YES" ] ; then \ language_cflags='' ; \ else \ language_cflags='-DKANJI' ; \ fi ; \ $(MAKE) actual_project \ "OFILE_DIR = $(OBJROOT)/$$obj_dir" \ "PROJ_CFLAGS = $(PROFILE_CFLAGS) $$language_cflags" \ "MAKEFILEDIR = $(MAKEFILEDIR)" \ "BUNDLE_EXTENSION = $$bundle_ext" \ "DEVROOT = $(DEVROOT)" \ "RC_CFLAGS = $$arch_cflags" \ "RC_ARCHS = $$archs" \ "SRCROOT = $(SRCROOT)" \ "OBJROOT = $(OBJROOT)" \ "PRODUCT_ROOT = $(PRODUCT_ROOT_WITHOUT_EXT).$$bundle_ext" \ "SYMROOT = $(SYMROOT)/sym" \ "SYM_DIR = $(SYMROOT)/sym" ) # The 'project' target should set BUNDLE_EXTENSION as appropriate. We need an # extra level of recursion here to insure this hhappens when this bundle is # part of an app. Note that the variables passed hrough here must match those # in the bundle target in common.make. project:: @($(set_bundle_ext) ; \ $(MAKE) actual_project \ "TOP_PRODUCT_ROOT = $(TOP_PRODUCT_ROOT)" \ "PRODUCT_ROOT = $(PRODUCT_ROOT)" \ "BUNDLE_DIR = $(BUNDLE_DIR)" \ "REL_BUNDLE_DIR = $(REL_BUNDLE_DIR)" \ "OFILE_DIR = $(OFILE_DIR)" \ "SYM_DIR = $(SYM_DIR)" \ "APP_MAKEFILE_DIR = $(APP_MAKEFILE_DIR)" \ "BUNDLE_EXTENSION = $$bundle_ext" \ "DEVROOT = $(DEVROOT)" \ "SRCROOT = $(SRCROOT)" \ "OBJROOT = $(OBJROOT)" \ "SYMROOT = $(SYMROOT)" \ "PROJ_CFLAGS = $(PROJ_CFLAGS)" \ "RC_ARCHS = $(RC_ARCHS)" \ "RC_CFLAGS = $(RC_CFLAGS)" ) actual_project:: $(INITIAL_TARGETS) subprojs bundles tools resources $(BUNDLE) TEMP_C_FILE = $(SYM_DIR)/$(NAME)_empty.c $(BUNDLE): $(PRODUCT_DEPENDS) $(PRODUCT_ROOT) $(SYM_DIR) @(if [ "`$(ECHO) $(OFILES) $(OTHER_OFILES) | wc -w`" != " 0" ] ; then \ cmd="$(CC) $(ALL_CFLAGS) -nostdlib $(BUNDLELDFLAGS) $(OFILES) $(OTHER_OFILES) $(BUNDLE_LIBS) -r -o $(BUNDLE)" ; \ echo $$cmd ; $$cmd ; \ else \ $(ECHO) Warning: Building empty bundle. ; \ $(RM) -f $(TEMP_C_FILE) ; \ $(TOUCH) $(TEMP_C_FILE) ; \ $(CC) $(ALL_CFLAGS) -c $(TEMP_C_FILE) -o $(BUNDLE) ; \ $(RM) -f $(TEMP_C_FILE) ; \ fi ; \ $(CHMOD) a+x $(BUNDLE) ) depend:: Makefile.dependencies $(SUBPROJECTS:.subproj=.depend) $(BUNDLES:.bproj=.depend) $(TOOLS:.tproj=.depend) $(PRODUCT_ROOT) \ $(DSTROOT)$(INSTALLDIR): $(MKDIRS) $@ THING_TO_STRIP = $(DSTROOT)$(PARENT_DIR)/$(NAME).$$bundle_ext/$(NAME) strip_myself:: @($(set_bundle_ext) ; \ bundle_dir_name_base=$(REL_BUNDLE_DIR:.bproj=) ; \ bundle_dir_name=$$bundle_dir_name_base.$$bundle_ext ; \ $(RM) -f $(DSTROOT)$(PARENT_DIR)/$$bundle_dir_name/$(CHANGES_FILE); \ echo Removed $(DSTROOT)$(PARENT_DIR)/$$bundle_dir_name/$(CHANGES_FILE); \ if [ -f $(THING_TO_STRIP) ] ; then \ cmd="$(STRIP) $(RELOCATABLE_STRIP_OPTS) $(THING_TO_STRIP)" ; \ echo $$cmd ; $$cmd ; \ else \ echo Warning: Not able to strip $(THING_TO_STRIP) ; \ fi) .bproj.strip .tproj.strip: @($(set_bundle_ext) ; \ cd $<; \ $(MAKE) strip "DSTROOT = $(DSTROOT)" \ "PARENT_DIR = $(PARENT_DIR)/$(NAME).$$bundle_ext" \ "NAME=$*") before_install:: $(DSTROOT)$(INSTALLDIR) @($(set_bundle_ext) ; \ cmd="$(RM) -rf $(DSTROOT)$(INSTALLDIR)/$(REL_BUNDLE_DIR:.bproj=).$$bundle_ext" ; \ echo $$cmd ; $$cmd ) after_install:: # Note that the following will not correctly install a standalone # bundle under a Jasper build. install:: bundle before_install installhdrs $(OTHER_INSTALL_DEPENDS) @($(set_bundle_ext) ; \ bundle_dir_name_base=$(REL_BUNDLE_DIR:.bproj=) ; \ bundle_dir_name=$$bundle_dir_name_base.$$bundle_ext ; \ $(MKDIRS) $(DSTROOT)$(INSTALLDIR) ; \ $(ECHO) Tar\'ing $$bundle_dir_name to $(DSTROOT)$(INSTALLDIR) ; \ (cd $(SYMROOT); $(TAR) chf - $$bundle_dir_name) | \ (cd $(DSTROOT)$(INSTALLDIR); $(TAR) xf -) ; \ $(MAKE) strip "DSTROOT = $(DSTROOT)" \ "PARENT_DIR = $(INSTALLDIR)" \ "BUNDLE_EXTENSION = $(BUNDLE_EXTENSION)" ; \ cmd="$(CHOWN) -Rf $(INSTALL_AS_USER).$(INSTALL_AS_GROUP) $(DSTROOT)$(INSTALLDIR)/$$bundle_dir_name" ; \ $(ECHO) $$cmd ; \ $$cmd || $(ECHO) Couldn\'t chown $(DSTROOT)$(INSTALLDIR)/$$bundle_dir_name ; \ cmd="$(CHMOD) -Rf go-w $(DSTROOT)$(INSTALLDIR)/$$bundle_dir_name" ; \ $(ECHO) $$cmd ; \ $$cmd || $(ECHO) Couldn\'t chmod $(DSTROOT)$(INSTALLDIR)/$$bundle_dir_name ; \ if [ "$(INSTALL_PERMISSIONS)" != "" ] ; then \ $(ECHO) $(CHMOD) -f $(INSTALL_PERMISSIONS) \ $(DSTROOT)$(INSTALLDIR)/$$bundle_dir_name; \ $(CHMOD) -f $(INSTALL_PERMISSIONS) \ $(DSTROOT)$(INSTALLDIR)/$$bundle_dir_name; \ fi ; \ $(process_target_archs)_obj ; \ $(MAKE) after_install "DSTROOT=$(DSTROOT)" \ "OBJROOT=$(OBJROOT)" \ "SYMROOT=$(SYMROOT)" \ "DEVROOT = $(DEVROOT)" \ "INSTALLDIR = $(INSTALLDIR)" \ "PRODUCT_ROOT = $(PRODUCT_ROOT)" \ "REL_PRODUCT_ROOT = $$bundle_dir_name" \ "SYM_DIR = $(SYMROOT)/sym" \ "OFILE_DIR = $(OBJROOT)/$$obj_dir" \ "PROJ_CFLAGS = $(NORMAL_CFLAGS)" \ "APP_MAKEFILE_DIR = $(APP_MAKEFILE_DIR)" \ "BUNDLE_EXTENSION = $$bundle_ext" \ "RC_CFLAGS = $$arch_cflags" \ "RC_ARCHS = $$archs" ) #.DEFAULT help: @if (test "$<"); then \ $(ECHO) 'ERROR: Unrecognized Makefile target "$<"'; \ fi @$(ECHO) 'The following targets are available:' @$(ECHO) @$(ECHO) ' all Makes the bundle target (below). This is the default target.' @$(ECHO) @$(ECHO) ' bundle Compiles and links an optimized (and debuggable) version of the' @$(ECHO) ' bundle into $(NAME).$(BUNDLE_EXTENSION)' @$(ECHO) @$(ECHO) ' depend Generates an optional Makefile.dependencies file for every level' @$(ECHO) ' of the bundle to reflect the complete dependency graph' @$(ECHO) ' (including headers).' @$(ECHO) @$(ECHO) ' install Builds (if needed) and copies <BundleName>.$(BUNDLE_EXTENSION)' @$(ECHO) ' into the installation directory, setting permissions' @$(ECHO) ' and owners as appropriate.' @$(ECHO) @$(ECHO) ' installsrc Installs the source files for the bundle into the directory' @$(ECHO) ' specified in the SRCROOT variable in a command-line argument.' @$(ECHO) ' Note: the target directory will be removed and recreated.' @$(ECHO) @$(ECHO) ' installhdrs Installs the header files for the bundle.' @$(ECHO) @$(ECHO) ' clean Removes all files in the bundle derived from previous builds.' @$(ECHO) @$(ECHO) ' help Lists these targets with their descriptions.' @$(ECHO) @$(ECHO) 'For more details, see the comments in /NextDeveloper/Makefiles/app/*.make.'